package com.mark.mall.web.platform.dto;

import com.mark.mall.web.platform.entity.Cart;
import com.mark.mall.web.platform.entity.Product;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author admin
 * Created on 2021/3/4 13:44
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("购物车列表")
@NoArgsConstructor
public class CartListDTO extends ProductDTO {
    @ApiModelProperty(value = "购买数量")
    private Integer num;
    @ApiModelProperty(value = "购物车id")
    private String cartId;

    public CartListDTO(Product product, Cart cart) {
        super(product);
        this.num = cart.getNum();
        this.cartId = cart.getId();
    }
}
